From: Igor Druzhinin Date: Fri, 28 Oct 2022 13:47:59 +0000 (+0200) Subject: x86/pv-shim: correctly ignore empty onlining requests X-Git-Tag: archive/raspbian/4.17.0-1+rpi1^2~33^2~90 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9272225ca72801fd9fa5b268a2d1c5adebd19cd9;p=xen.git x86/pv-shim: correctly ignore empty onlining requests Mem-op requests may have zero extents. Such requests need treating as no-ops. pv_shim_online_memory(), however, would have tried to take 2³²-1 order-sized pages from its balloon list (to then populate them), typically ending when the entire set of ballooned pages of this order was consumed. Note that pv_shim_offline_memory() does not have such an issue. Fixes: b2245acc60c3 ("xen/pvshim: memory hotplug") Signed-off-by: Igor Druzhinin Signed-off-by: Jan Beulich Acked-by: Andrew Cooper Release-acked-by: Henry Wang --- diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c index 49ce4f93f2..ae1a0e6e65 100644 --- a/xen/arch/x86/pv/shim.c +++ b/xen/arch/x86/pv/shim.c @@ -944,6 +944,9 @@ void pv_shim_online_memory(unsigned int nr, unsigned int order) struct page_info *page, *tmp; PAGE_LIST_HEAD(list); + if ( !nr ) + return; + spin_lock(&balloon_lock); page_list_for_each_safe ( page, tmp, &balloon ) {